package com.example.accessdemo.service;

import com.dtflys.forest.annotation.Address;
import com.dtflys.forest.annotation.Body;
import com.dtflys.forest.annotation.Post;
import com.example.accessdemo.config.MyAddressSource;

@Address(source = MyAddressSource.class)
public interface MyClient {

    /**
     * ac获取
     * @param username
     * @param password
     * @param responseType
     * @param clientId
     * @param redirectURI
     * @param clientType
     * @return
     */

    @Post("/jreap/authorizeApp.form")
    String getAccToken(
            @Body("loginName")  String username,
            @Body("password")   String password,
            @Body("response_type") String responseType,
            @Body("client_id")      String clientId,
            @Body("redirect_uri")   String redirectURI,
            @Body("clientType")     String clientType
    );

    @Post("/jreap/accessTokenApp.form")
    String getJreapSid(
            @Body("grant_type") String grantType,
            @Body("client_id") String clientId,
            @Body("code") String code,
            @Body("client_secret") String client_secret,
            @Body("redirect_uri") String redirect_uri,
            @Body("clientType") String clientType,
            @Body("jreapSid") String jreapSid
    );

}
